﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace GameJamKingdom
{
    class TutorialScreen:State
    {
        Texture2D background;
        int timeElapsed;

        public TutorialScreen(Game1 cGame)
        {
            Initialize(cGame);
        }

        public override void Initialize(Game1 cGame)
        {
            background = cGame.Content.Load<Texture2D>("Instructions");
            timeElapsed = 0;
        }


        public override void Update(Game1 cGame, GameTime gameTime)
        {
            KeyboardState cKeyState;
            cKeyState = Keyboard.GetState();

            timeElapsed += (int)gameTime.ElapsedGameTime.TotalMilliseconds;

            if (cKeyState.IsKeyDown(Keys.Enter) && (timeElapsed > 100))
            {
                cGame.cState = "gameplay";
                timeElapsed = 0;
            }
        }

        public override void Draw(SpriteBatch spriteBatch)
        {
            spriteBatch.Begin();
            spriteBatch.Draw(background, new Rectangle(0, 0, Program.wWidth, Program.wHeight), Color.White);
            spriteBatch.End();
        }
    }
}
